package com.sfac.javaSpringBoot.modules.common.dao;

import com.sfac.javaSpringBoot.modules.common.entity.ExceptionLog;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ExceptionLogDao {

//    @Select("select * from common_exception_log where" +  报错找到了
      @Select("select * from common_exception_log where " +
//            "path = #{path} and method_name = #{methodName} and" +
              "path = #{path} and method_name = #{methodName} and " +
//            "exception_type = #{exceptionType}")
              "exception_type = #{exceptionType}")
//    List<ExceptionLog> getExceptionLogsByParam(
      List<ExceptionLog> getExceptionLogsByParam(
//            @Param("path") String path,
              @Param("path") String path,
//            @Param("methodName")String methodName,
              @Param("methodName")String methodName,
//            @Param("exceptionType")String exceptionType);
              @Param("exceptionType")String exceptionType);
//
//
//    @Insert("insert into common_exception_log(ip, path, class_name, method_name," +
      @Insert("insert into common_exception_log (ip, path, class_name, method_name, " +
//            "exception_type, exception_message, create_date)" +
              "exception_type, exception_message, create_date)" +
//            "values (#{ip}, #{path}, #{className}, #{methodName}," +
              "values (#{ip}, #{path}, #{className}, #{methodName}," +
//            "#{exceptionType}, #{exceptionMessage}, #{createDate})")
              "#{exceptionType}, #{exceptionMessage}, #{createDate})")
//    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
      @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
//    void insertExceptionLog(ExceptionLog exceptionLog);
      void insertExceptionLog(ExceptionLog exceptionLog);
}
